package com.bestv.engine.sorter;

import com.bestv.engine.model.RecommendationRule;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Henry on 14-7-24.
 */
public class Sorters {
    private List<Sorter> sorterChain;

    public Sorters() {
        sorterChain = new ArrayList<Sorter>();
    }

    public void sort(RecommendationRule rule) {
        for (Sorter sorter : sorterChain) {
            sorter.sort(rule.getRecommendationItemList());
        }
    }

    public void add(Sorter sorter) {
        sorterChain.add(sorter);
    }
}
